<template>
	<div class="main">
	<van-nav-bar
	  title="问卷选项"
	  left-text="返回"
	  left-arrow
	  @click-left="onClickLeft"
	/>
	<div class="paper"  v-for="(item,index) in paperItem" :key="index">
					<!-- <div >{{index}}</div> -->
					<div class="title" >{{index+1}}.{{item.paperItemTitle}}({{item.itemPointValue}})</div>
					<div class="select" >
					<van-radio-group v-model="checked[index].name"  disabled class="item">
					  <van-radio name="A" icon-size="18px">A.{{item.optionA}}</van-radio>
					  <van-radio name="B" icon-size="18px">B.{{item.optionB}}</van-radio>
					  <van-radio name="C" icon-size="18px">C.{{item.optionC}}</van-radio>
					  <van-radio name="D" icon-size="18px">D.{{item.optionD}}</van-radio>
					  <van-radio name="E" icon-size="18px">E.{{item.optionE}}</van-radio>
					</van-radio-group></div>
					<!-- <van-divider
				  :style="{ color: '#1989fa', borderColor: '#1989fa'}"
				>
				</van-divider> -->
				</div>
				<!-- <div class="button">
					<div class="chongzhi"><van-button plain hairline type="warning" @click="rest()">重置</van-button></div>
					<div class="tijiao"><van-button plain hairline type="primary" @click="tijiao">提交</van-button></div>
				</div> -->
		</div>
</template>

<script>
	import {getEvaluationList} from '@/api/pjResult'
	import {ItemList} from '@/api/pj'
	export default {
		data() {
			return{
				evaluationId:this.$route.query.evaluationIds,
				checked:[],
				id:this.$route.query.index,
				param:{
					pageNum:1,
					pageSize:10,
					PaperItemCategoryId:null,
					evaluationPaperId:null
				},
				paperItem:[],
				evaluationPaperId:null
			}
		},
		created() {
			this.getPaperItem()
			// this.getEvaluationList()
		},
		methods:{
			async getEvaluationList(){
				const result=await getEvaluationList(this.evaluationId)
				if(result.code==200){
					
					this.checked=result.data
					console.log(this.checked)
				}
			},
			async getPaperItem(){
				this.param.PaperItemCategoryId=this.id
				
				const result=await ItemList(this.param);
				if(result.code==200){
					
					this.paperItem=result.rows
					this.getEvaluationList()
					this.evaluationPaperId=result.rows[0].evaluationPaperId
					console.log(this.paperItem)
				}
			},
			onClickLeft(){
				this.$router.push({path:'/Info/detail',query:{index:this.evaluationPaperId}})
			}
		}
	}
</script>

<style scoped>
	.paper{
		padding-left: 3px;
		padding-top: 10px;
	}
	.paper .title{
		font-size: 20px;
	}
	.paper .select{
		font-size: 18px;
	}
	.van-radio-label-margin{
		margin-top: 3px;
	}
	.button{
		display: flex;
		padding: 10px 0 0 0;
	}
	.button .chongzhi{
		padding: 0 0 0 70px;
	}
	.button .tijiao{
		padding:  0 0 0 120px;
	}
</style>